import { PagingType } from "./common"
import { TypeListType } from "./typeManage"

export type CommodityListType = {
  teaId: number,
  teaName: string,
  teaType: TypeListType['typeId'],
  cover: string,
  price: number,
  number: number,
  creator: number,
  createTime: string,
  updator: number,
  updateTime: string
}

export type GetTeaListParam = {
  teaType: TypeListType['typeId'] | '',
  teaName: CommodityListType['teaName'] | '',
  enable: 0 | 1
} & PagingType

export type AddCommdity = {
  teaName: string | ''
  teaType: TypeListType['typeId'] | ''
  cover: string | ''
  price: number | ''
  number: number | ''
}
export type EditCommdity = AddCommdity & {
  teaId: number,
}

export type EnableCommdityParams = {
  teaId: CommodityListType['teaId']
  enable: GetTeaListParam['enable']
}

export type GetTeaItemQuery = {
  teaId: CommodityListType['teaId']
}
export type TeaItemListType = {
  itemCover: string,
  itemId: number
}

/** 商品的轮播图 **/
export type AddTeaItemParam = {
  itemCover: string,
  teaId: CommodityListType["teaId"]
}